package org.erepublik.company.searchCriteria;

import java.util.Comparator;

import org.erepublik.company.CountryData;
import org.erepublik.company.comparators.CountryDataComparatorByName;
import org.erepublik.company.comparators.CountryDataComparatorByNewPopulation;
import org.erepublik.company.comparators.CountryDataComparatorByOnline;
import org.erepublik.company.comparators.CountryDataComparatorByPopulation;

public enum ECountrySortCriteria {
    COUNTRY(new CountryDataComparatorByName(), "Country name"),
    POPULATION(new CountryDataComparatorByPopulation(), "Population"),
    NEW_CITIZENS(new CountryDataComparatorByNewPopulation(), "New citizens today"),
    ONLINE(new CountryDataComparatorByOnline(), "Citizens online");
    
    ECountrySortCriteria( Comparator<? super CountryData> comparator, String name) {
        this.name = name;
        this.comparator = comparator;
    }
    
    private Comparator<? super CountryData> comparator;
    private String name;
    public Comparator<? super CountryData> getComparator() {
        return comparator;
    }
    public String getName() {
        return name;
    }
}
